<?php
	include_once "dataservice.php";
	
	class captcha_db
	{
		public function CapNhat($SuDungCaptcha)
		{
			$sql = "UPDATE 	`tbl_captcha` 
					SET 	`SuDungCaptcha` = '$SuDungCaptcha' 
					WHERE 	1";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function LayDanhSach($SuDungCaptcha)
		{
			$sql = "SELECT 	* 
					FROM 	`tbl_captcha` 
					WHERE 	1 ";
			if($SuDungCaptcha != -1)
				$sql .= "AND `SuDungCaptcha` = '$SuDungCaptcha'";
			
			$service = new dataservice();
			return $service->ExecuteQuery($sql);
		}
	}
?>